import request from "@/utils/request"

// 查询销售发文单列表
export function listSalesDocument(query) {
	return request({
		url: "/erp/salesDocument/list",
		method: "get",
		params: query
	})
}

// 查询销售发文单详细
export function getSalesDocument(id) {
	return request({
		url: "/erp/salesDocument/" + id,
		method: "get"
	})
}

// 新增销售发文单
export function addSalesDocument(data) {
	return request({
		url: "/erp/salesDocument",
		method: "post",
		data: data
	})
}

// 修改销售发文单
export function updateSalesDocument(data) {
	return request({
		url: "/erp/salesDocument",
		method: "put",
		data: data
	})
}

// 删除销售发文单
export function delSalesDocument(id) {
	return request({
		url: "/erp/salesDocument/" + id,
		method: "delete"
	})
}

// 查询结算列表
export function getSettlementList() {
	return request({
		url: "/erp/salesDocument/settleList",
		method: "get"
	})
}

// 根据ids查询子列表
export function getSublist(ids) {
	return request({
		url: `/erp/salesDocument/getMarketDetails/${ids}`,
		method: "get"
	})
}
